cmake_minimum_required(VERSION 3.0)
if(POLICY CMP0054)
  cmake_policy(SET CMP0054 NEW)
endif()
if(POLICY CMP0063)
  cmake_policy(SET CMP0063 NEW)
endif()

include(${CMAKE_CURRENT_LIST_DIR}/../lib/functions.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/../lib/options.cmake)

j_set_path(j_project_file ${PROJECT_FILE})
set(j_config ${CMAKE_BUILD_TYPE})
include(${j_project_file})
j_assert("function j_prepare not defined" COMMAND j_prepare)
j_assert("function j_main not defined" COMMAND j_main)

j_define_global_variables()
include(${CMAKE_CURRENT_LIST_DIR}/../../config.cmake OPTIONAL)
j_prepare()
j_set_global_variables()

file(MAKE_DIRECTORY ${j_generated_project_dir})

j_print_global_settings()

